home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
bbs
/
fax_it_cnet.lzh
/
FAX-IT
/
fax-it
< prev
next >
Wrap
Text File
|
1994-09-10
|
11KB
|
438 lines
/*
** FAX-IT! V3.0 By: Glenn J. Schworak ((CNet Version))
**
** ******************************************************
** * This program should not be altered for any reason. *
** * Any changes may cause the program to fail *
** ******************************************************
**
** This is a door program to allow messages to be written on any
** Excelsior! BBS system. The system must also have GPFax running
** when the FAX messages are sent out using AutoFAX.
**
** If you modify these scripts to run on any BBS other than Excelsior!
** you MUST re-archive all the files and return it to me. You are allowed
** to take credit for any of the modifications you make but DO NOT start
** to distribute your work until I get a copy please.
**
** This program was written by Glenn J. Schworak February, 1994
**
** FAX-IT is Copyright ©1994 by Boundless Systems & Software
** 1710 Lee Street SE
** Salem, Oregon 97302
** (503) 399-7518 - Voice Line
** (503) 581-6524 - FAX/BBS Line
*/
Options Results
GetUser 27 ; TrueWidth = Result
GetUser 3 ; TrueName = Result
GetUser 1 ; TrueAlias = Result
GetUser 4 ; TrueLocal = Result
GetUser 5 ; TrueLocal = TrueLocal' 'Result
GetUser 56 ; TrueLocal = TrueLocal' ('Result')'
GetUser 6 ; TrueAddress = Result
GetUser 9 ; TrueNumber = Result
GetUser 40 ; TrueID = Result
GetUser 23 ; Portx = Result
GetUser 2307386 ; WorkPath = Result
Doors = 'Doors:'
FaxIT = Doors'Fax-IT/'
Config = FaxIT'Fax-It.cfg'
Times = FaxIT'FAX-Times'
Numbers = FaxIT'Numbers/'
NumFile = FAXIT'NumberList.'TrueID
Spawn FaxIT'FAX-Stat'
bufferflush
Signal On IOerr
Signal On syntax
ChangeWhere 'FAX-IT!'
ChangeWhat 'Initializing'
Yes = 'YES'
No = 'NO'
SendFile Doors'Fax-IT/FAX-IT.Welcome'
Print 'c4k1FAX-IT v3.0k0 c5by c2Glenn J. Schworakc5 for k1 EXCELSIOR! BBSk0c5 andk1 GPFaxk0c5 software!q1n1'
Print 'cbCNet Modification by Malcolm Anderson. n1cfCall The AfterHOurs Cafe BBS (209) 464-0219n1'
Print 'c1Please DO NOT use MCI commands in this message. FAX machines do not understand them so they will be printed just as you enter them.n1'
Print 'k1r1Note:q1 c4Your real name, phone number, and address are attached to'
Print 'c4 each FAX you send out.n2'
/*
* Reading the config file
*/
settings=0
if open(cfg,config,'read') then do
do while ~eof(cfg)
text=upper(readln(cfg))
if left(text,1)~=';' | length(text)<4 then do
if text='FORCEFAX' then do
ForceFAX=trim(upper(ReadLN(cfg)))
Settings=Settings+1
end
if text='LOCALONLY' then do
LocalOnly=trim(upper(ReadLN(cfg)))
settings=settings+1
end
if text='LOCALPREFIX' then do
LocalPrefix=Trim(readln(cfg))
settings=settings+1
end
if text='ALLOWLONG' then do
AllowLong=Trim(readln(cfg))
settings=settings+1
end
if text='TIMEMSG' then do
TimeMSG=trim(readln(cfg))
settings=settings+1
end
if text='SAREA' then do
SArea=trim(readln(cfg))
settings=settings+1
end
if text='SPICT' then do
SPict=trim(readln(cfg))
settings=settings+1
if SPict='*' | length(SPict)=0 then SPict=""; else Spict='G'SPict
end
if text='SNAME' then do
SName=trim(Readln(cfg))
settings=settings+1
end
if text='SNUM' then do
SNum=trim(readln(cfg))
settings=settings+1
end
if text='SLOCAL' then do
SLocal=trim(readln(cfg))
settings=settings+1
end
if text='SMESSAGE' then do
SMessage=trim(readln(cfg))
settings=settings+1
end
end
end
close(cfg)
end
if settings>11 then do
Print 'There are too many entries in the config file. FAX abortedn2'
call quit
end
if settings<11 then do
Print 'There are not enough entries in the config file. FAX abortedn2'
call quit
end
/*
* Check for sysop or user access group that will over ride the
* local only setting. Sysop can send to any number and so can a user
* with an access group found in the variable AllowLong listed above.
*/
GetUser 17 ; If Result = 1 Then LocalOnly = NO
GetUser 15 ; If index(AllowLong,'-'Result'-')>0 then LocalOnly = NO
/*
* Main Program - Please DO NOT make any changes below this point.
*/
stat=Exists(Times)
if stat~=1 then do
Print 'b1c1ERROR: c6The c3FAX-Times c6file is missing from the FAX-IT door area...w4q1'
Call Quit
end
Open(tempfile,Times,'read')
hours=readln(tempfile)
days=readln(tempfile)
Close(tempfile)
Now = '-'Time('Hours')'-'
Day = SubStr(Date('W'),1,3)
TrueTime = Time('C')' 'Date('Normal')
FileTime = 'GJSFAX'Compress(Date(Sorted)'.'Time(),':')
If Index(Hours,Now)=0 | Index(Days,Day)=0 Then SendNow=No; else SendNow=Yes
address command 'list >'NumFile' "'Numbers'~(1 #?)" LFormat "%s"'
if LocalOnly=No then address command 'list >>'NumFile' "'Numbers'1 #?" LFormat "%s"'
Print TimeMSG
TempNum='***'
do while TempNum='***'
Print 'n2c6(Type c7HELPc6 for more information or c7LISTc6 for phone numbers)'
Query 'q1Enter the phone number or company name to send your FAX to? c2'
TempNum = Result
if TempNum='' then do
print 'c1NO FAX SENTq1n2'
Call Quit
end
if Upper(TempNum)='HELP' then do
print 'f1b1'
SendFile Doors'Fax-IT/Help.FAX'
TempNum='***'
end
if Upper(TempNum)='LIST' then do
Print 'f1b1q1To add your number to the list contact the Sysopn2c2List of FAX numbers known to this system...n2'
lines=6
if open(FileList,NumFile,'Read') then do
do while ~eof(FileList) & lines>=0
filename=readln(FileList)
if open(NumberFile,Numbers||filename,'Read') then do
print 'n1c6'filename'q1'
lines=lines+2
do while ~eof(NumberFile)
text=readln(NumberFile)
if length(text)>1 then do
print text
lines=lines+1
end
end
close(NumberFile)
if lines>20 then do
lines=0
Query 'n1q1More (c2Yq1/n) '
if result='n' then lines=-5
end
end
end
close(FileList)
end
TempNum='***'
print 'n2k1 --- END OF LIST --- k0q1'
end
TempText=Upper(TempNum)
lines=0
if open(FileList,NumFile,'Read') then do
do while ~eof(FileList) & lines>=0
filename=readln(FileList)
if open(NumberFile,Numbers||filename,'Read') then do
text=left(readln(NumberFile),length(TempText))
if Upper(text)=TempText then do
TempNum=FileName
lines=-1
end
close(NumberFile)
end
end
close(FileList)
end
RealNum = ""
TempNum = Compress(TempNum)
Size=WordLength(TempNum,1)
Z=1
If SubStr(TempNum,1,1)='1' Then Z=2
Do X=Z to Size
If DataType(SubStr(TempNum,X,1),'Numeric') Then RealNum=RealNum||SubStr(TempNum,X,1)
End
Size = WordLength(RealNum,1,1)
PreFix=SubStr(RealNum,1,3)
LongDist=Yes
If Index(LocalPrefix,Prefix)>0 then LongDist=No
If LocalOnly=Yes & (Size>7 | LongDist=Yes) Then do
RealNum=''
Size=0
Print 'c1Sorry, your access is not high enough to send'
print 'a FAX to a long distance phone numbers.'
TempNum='***'
end
If SubStr(RealNum,1,3)=SArea then do
Size=Size-3
RealNum=SubStr(RealNum,4,Size)
End
If Size~=7 & Size~=10 Then do
if TempNum~='***' then do
Print 'c1This seems to be an invalid number...n1q1Please re-enter your number or leave the number blank to exit.'
TempNum='***'
end
End
end
If Size=7 Then do
RealNum=Insert('-',RealNum,3)
end
If Size=10 Then do
RealNum=Insert('-',RealNum,6)
RealNum=Insert(') ',RealNum,3)
RealNum=Insert('(',RealNum)
End
Dial=RealNum
If LongDist=Yes then Dial='1 'RealNum
print 'n2q1Send FAX to: c7'Dial
if exists(Numbers||Dial) then do
if open(message,Numbers||Dial,'Read') then do
do while ~eof(message)
print readln(message)
end
close(message)
end
end
Query 'n1q1Who is this FAX to be addressed to? c2'
Attention = Result
if Attention = '' Then Attention = 'Whom It May Concern'
Prompt 30 NORMAL 'q1Subject: c2'
Subject = Result
if Subject = '' Then Subject = '<None>'
ChangeWhat 'Verifying'
Print 'n3q1Send c6'Attention'q1 a FAX at c6'RealNum
Prompt 1 YESNO '"n1q1b1Is this information correct? (c2Yq1/n) "'
Continue=Result
If Continue~='Yes' then do
Print 'n3c1*** FAX TERMINATED BY USER ***q1n2'
Call Quit
end
Shell Command 'Delete <>NIL: 'workpath'_edbuff'portx
if TrueWidth>65 Then SetWidth 65
ClearEditor
ChangeWhat 'Entering Message'
SetWidth TrueWidth
CallEditor
if ~exists(workpath'_edbuff'Portx) then do
Print 'n2c1*** NO FAX WILL BE SENT ***q1n2'
Call Quit
end
TempFile = 'T:'FileTime
RealFile = Doors'Fax-IT/Text/'FileTime
SaveEditor TempFile
File=Open('OutFile',RealFile,'Write')
If File~=1 Then do
Print 'n2c1b9ERROR CREATING FAX PRIMER FILE --- NO FAX WILL BE SENTq1n2'
Call Quit
end
WriteLN('OutFile',Dial)
WriteLN('OutFile',SPict)
WriteLN('OutFile','')
WriteLN('OutFile','This Message is coming to you by way of....')
WriteLN('OutFile',' 'SName)
WriteLN('OutFile',' 'SLocal)
WriteLN('OutFile',' 'SNum)
WriteLN('OutFile',' 'SMessage)
WriteLN('OutFile','')
WriteLN('OutFile','')
WriteLN('OutFile','')
WriteLN('OutFile','')
WriteLN('OutFile',' TO: 'Attention)
WriteLN('OutFile',' FAX: 'RealNum)
WriteLN('OutFile','SUBJECT: 'Subject)
WriteLN('OutFile','')
WriteLN('OutFile','')
WriteLN('OutFile','')
WriteLN('OutFile',' FROM: 'TrueName' #'TrueID)
WriteLN('OutFile',' VOICE: 'TrueNumber)
WriteLN('OutFile',' ADDR: 'TrueAddress)
WriteLN('OutFile',' 'TrueLocal)
WriteLN('OutFile','')
WriteLN('OutFile','WRITTEN: 'TrueTime)
WriteLN('OutFile','P')
File = Open('InFile',TempFile,'Read')
if File~=1 then do
Print 'c1n2b5ERROR COMPLETING FAX PRIMER FILE --- FAX MAY BE DAMAGEDq1n2'
Close('OutFile')
Call Quit
end
do while ~EOF('InFile')
TempLine = ReadLN('InFile')
WriteLN('OutFile',TempLine)
end
Close('OutFile')
Close('InFile')
SysopLog 'n1b1c6FAX-IT message written by 'TrueAlias' 'TrueTime' to 'RealNum'q1n1'
if ~Show(port,REXX_GPFAX) then do
Print 'n2c6Your FAX can not be sent at this time.n2'
Print 'q1The FAX is now in the holding area and will be sent at the next'
Print 'available FAX time.n2'
Call Quit
end
Try=Exists('T:FAXnode')
Address Command 'Delete T:GJSFAX#?'
if ForceFAX=Yes & SendNow=No then do
Print 'n2c6It is now 'time('civil')' on a 'date(w)'.n2'
Query 'q1This is outside of the normal FAXing times. Try anyway? (y/c1Nq1) '
if Result="y" then do
Call Force
SendNow=Yes
end
else do
Print 'Your message will be sent at the next available FAX time.n2'
end
end
if Try='1' & SendNow=Yes then do
Call Force
Print 'The FAX line is in use at the momentn2Your FAX will be sent as soon as the line is free.n2'
Call Quit
end
if SendNow=Yes then do
Print 'The FAX line is free at the moment so your fax is now being sent.n2'
address command 'C:Run >NIL: SYS:RexxC/RX 'Doors'Fax-IT/AutoFAX.gpf'
Call Quit
end
Print 'Your message will be sent at the next available FAX time.n2'
Call Quit
Syntax: Print 'Syntax Error Hit! Tell the sysop...'
Call Quit
IOerr: Print 'I/O Error Hit! Tell the sysop...'
Call Quit
Force:
Open(tempfile,'T:FAX-NOW','write')
writeln(tempfile,FileTime)
Close(tempfile)
return
Quit:
address command 'Delete 'NumFile
exit